import { ORDER_DETAILS_DATA} from "./actionsTypes";
export const orderDetailsData = data => ({type: ORDER_DETAILS_DATA, data: data});//选中的车牌号码
import oderDetailsService from  '../services/orderDetailsService';
import { Toast } from 'antd-mobile'

export const getOrderDetails =(data,callBack)=>{
	return (dispatch, getState)=> {
		Toast.hide();
		Toast.loading("", 30, () => Toast.info("网络错误", 2));
		oderDetailsService.getOrderDetails(data).then(resultData => {
			Toast.hide();
			if (resultData.code == 1000) {
				dispatch(orderDetailsData(resultData.body))
			} else {
				Toast.info(resultData.msg);
			}
		},()=>{
			Toast.hide(); 
            Toast.info("系统繁忙，请稍后再试");
		});
	}
}